package com.itboye.ihomebank.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Environment;
/**
* 保存钥匙（数据库）
*
*/
public class DBOpenHelperKey extends SQLiteOpenHelper{
	public static final String DB_PATH = "/data"
			+ Environment.getDataDirectory().getAbsolutePath() + "/"
			+ "com.itboye.ihomebank"; // 存放路径
	
	public static final String MEKEYDB="mekey.db";
	
	public DBOpenHelperKey(Context context) {
		super(context, MEKEYDB, null, 1);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		//调用execSQL()方法执行建表语句我的钥匙列表)
		db.execSQL("create table mykey(id integer primary key autoincrement, lock_id varchar(50), key_id varchar(50), start varchar(50), end varchar(50), create_time varchar(50), update_time varchar(50), status varchar(50), type varchar(50), lock_alias varchar(50), house_no varchar(50), user_type varchar(50), lock_mac varchar(50), push varchar(50), key_status varchar(50), is_new varchar(50))");
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		
	}
	public boolean deleteDatabase(Context context) {
		return context.deleteDatabase(MEKEYDB);
	}

}
